import axios from 'axios';

function App() {
    const getPeopleInfo = () => {
        axios({
            method: 'get',
            url: 'http://localhost:3000/api1/students'
        }).then(res => {
            console.log(res.data);
        });
    };

    const getCarInfo = () => {
        axios({
            method: 'get',
            url: 'http://localhost:3000/api2/cars'
        }).then(res => {
            console.log(res.data);
        });
    };

    return (
        <div>
            <button onClick={getPeopleInfo}>获取人员信息</button>
            <button onClick={getCarInfo}>获取车辆信息</button>
        </div>
    );
}

export default App;
